type go/parser.parser
93 uses
go/parser (current package)
interface.go#L97: var p parser
interface.go#L214: var p parser
parser.go#L38: type parser struct {
parser.go#L79: func (p *parser) init(file *token.File, src []byte, mode Mode) {
parser.go#L93: func (p *parser) printTrace(a ...any) {
parser.go#L108: func trace(p *parser, msg string) *parser {
parser.go#L115: func un(p *parser) {
parser.go#L123: func incNestLev(p *parser) *parser {
parser.go#L134: func decNestLev(p *parser) {
parser.go#L139: func (p *parser) next0() {
parser.go#L180: func (p *parser) lineFor(pos token.Pos) int {
parser.go#L185: func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
parser.go#L208: func (p *parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) {
parser.go#L238: func (p *parser) next() {
parser.go#L280: func (p *parser) error(pos token.Pos, msg string) {
parser.go#L303: func (p *parser) errorExpected(pos token.Pos, msg string) {
parser.go#L321: func (p *parser) expect(tok token.Token) token.Pos {
parser.go#L332: func (p *parser) expect2(tok token.Token) (pos token.Pos) {
parser.go#L344: func (p *parser) expectClosing(tok token.Token, context string) token.Pos {
parser.go#L353: func (p *parser) expectSemi() (comment *ast.CommentGroup) {
parser.go#L379: func (p *parser) atComma(context string, follow token.Token) bool {
parser.go#L402: func (p *parser) advance(to map[token.Token]bool) {
parser.go#L466: func (p *parser) parseIdent() *ast.Ident {
parser.go#L478: func (p *parser) parseIdentList() (list []*ast.Ident) {
parser.go#L496: func (p *parser) parseExprList() (list []ast.Expr) {
parser.go#L510: func (p *parser) parseList(inRhs bool) []ast.Expr {
parser.go#L521: func (p *parser) parseType() ast.Expr {
parser.go#L538: func (p *parser) parseQualifiedIdent(ident *ast.Ident) ast.Expr {
parser.go#L552: func (p *parser) parseTypeName(ident *ast.Ident) ast.Expr {
parser.go#L573: func (p *parser) parseArrayType(lbrack token.Pos, len ast.Expr) *ast.ArrayType {
parser.go#L601: func (p *parser) parseArrayFieldOrTypeInstance(x *ast.Ident) (*ast.Ident, ast.Expr) {
parser.go#L648: func (p *parser) parseFieldDecl() *ast.Field {
parser.go#L739: func (p *parser) parseStructType() *ast.StructType {
parser.go#L765: func (p *parser) parsePointerType() *ast.StarExpr {
parser.go#L776: func (p *parser) parseDotsType() *ast.Ellipsis {
parser.go#L792: func (p *parser) parseParamDecl(name *ast.Ident, typeSetsOK bool) (f field) {
parser.go#L875: func (p *parser) parseParameterList(name0 *ast.Ident, typ0 ast.Expr, closing token.Token, dddok bool) (params []*ast.Field) {
parser.go#L1065: func (p *parser) parseTypeParameters() *ast.FieldList {
parser.go#L1085: func (p *parser) parseParameters(result bool) *ast.FieldList {
parser.go#L1109: func (p *parser) parseFuncType() *ast.FuncType {
parser.go#L1128: func (p *parser) parseMethodSpec() *ast.Field {
parser.go#L1210: func (p *parser) embeddedElem(x ast.Expr) ast.Expr {
parser.go#L1229: func (p *parser) embeddedTerm() ast.Expr {
parser.go#L1253: func (p *parser) parseInterfaceType() *ast.InterfaceType {
parser.go#L1302: func (p *parser) parseMapType() *ast.MapType {
parser.go#L1316: func (p *parser) parseChanType() *ast.ChanType {
parser.go#L1341: func (p *parser) parseTypeInstance(typ ast.Expr) ast.Expr {
parser.go#L1373: func (p *parser) tryIdentOrType() ast.Expr {
parser.go#L1413: func (p *parser) parseStmtList() (list []ast.Stmt) {
parser.go#L1425: func (p *parser) parseBody() *ast.BlockStmt {
parser.go#L1437: func (p *parser) parseBlockStmt() *ast.BlockStmt {
parser.go#L1452: func (p *parser) parseFuncTypeOrLit() ast.Expr {
parser.go#L1472: func (p *parser) parseOperand() ast.Expr {
parser.go#L1518: func (p *parser) parseSelector(x ast.Expr) ast.Expr {
parser.go#L1528: func (p *parser) parseTypeAssertion(x ast.Expr) ast.Expr {
parser.go#L1546: func (p *parser) parseIndexOrSliceOrInstance(x ast.Expr) ast.Expr {
parser.go#L1630: func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
parser.go#L1656: func (p *parser) parseValue() ast.Expr {
parser.go#L1670: func (p *parser) parseElement() ast.Expr {
parser.go#L1685: func (p *parser) parseElementList() (list []ast.Expr) {
parser.go#L1701: func (p *parser) parseLiteralValue(typ ast.Expr) ast.Expr {
parser.go#L1719: func (p *parser) parsePrimaryExpr(x ast.Expr) ast.Expr {
parser.go#L1792: func (p *parser) parseUnaryExpr() ast.Expr {
parser.go#L1863: func (p *parser) tokPrec() (token.Token, int) {
parser.go#L1875: func (p *parser) parseBinaryExpr(x ast.Expr, prec1 int) ast.Expr {
parser.go#L1901: func (p *parser) parseExpr() ast.Expr {
parser.go#L1909: func (p *parser) parseRhs() ast.Expr {
parser.go#L1931: func (p *parser) parseSimpleStmt(mode int) (ast.Stmt, bool) {
parser.go#L2004: func (p *parser) parseCallExpr(callType string) *ast.CallExpr {
parser.go#L2020: func (p *parser) parseGoStmt() ast.Stmt {
parser.go#L2035: func (p *parser) parseDeferStmt() ast.Stmt {
parser.go#L2050: func (p *parser) parseReturnStmt() *ast.ReturnStmt {
parser.go#L2066: func (p *parser) parseBranchStmt(tok token.Token) *ast.BranchStmt {
parser.go#L2081: func (p *parser) makeExpr(s ast.Stmt, want string) ast.Expr {
parser.go#L2099: func (p *parser) parseIfHeader() (init ast.Stmt, cond ast.Expr) {
parser.go#L2159: func (p *parser) parseIfStmt() *ast.IfStmt {
parser.go#L2191: func (p *parser) parseCaseClause() *ast.CaseClause {
parser.go#L2216: func (p *parser) isTypeSwitchGuard(s ast.Stmt) bool {
parser.go#L2237: func (p *parser) parseSwitchStmt() ast.Stmt {
parser.go#L2291: func (p *parser) parseCommClause() *ast.CommClause {
parser.go#L2343: func (p *parser) parseSelectStmt() *ast.SelectStmt {
parser.go#L2361: func (p *parser) parseForStmt() ast.Stmt {
parser.go#L2443: func (p *parser) parseStmt() (s ast.Stmt) {
parser.go#L2509: func (p *parser) parseImportSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
parser.go#L2551: func (p *parser) parseValueSpec(doc *ast.CommentGroup, keyword token.Token, iota int) ast.Spec {
parser.go#L2592: func (p *parser) parseGenericType(spec *ast.TypeSpec, openPos token.Pos, name0 *ast.Ident, typ0 ast.Expr) {
parser.go#L2608: func (p *parser) parseTypeSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
parser.go#L2753: func (p *parser) parseGenDecl(keyword token.Token, f parseSpecFunction) *ast.GenDecl {
parser.go#L2784: func (p *parser) parseFuncDecl() *ast.FuncDecl {
parser.go#L2844: func (p *parser) parseDecl(sync map[token.Token]bool) ast.Decl {
parser.go#L2876: func (p *parser) parseFile() *ast.File {